package com.ymttest.database.mapping;

import com.ymttest.database.model.YmtExpressSellerToMode;

import java.util.List;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

public interface SellerMapperV2 {
    /**
    * 添加用户的物流方式发布权限 
    * select  * from  Ymt_ExpressSellerToMode  where SellerId = 3383   and isDelete =0
    * 
    *  Unknown =0：未知

        China = 1, // 进口贸易

        US = 2, //第三方直邮，直邮.由非官方认证的第三方国际物流公司进行承运，从海外空运并清关后完成配送

        SailProtect = 3, //贝海直邮.由洋码头官方物流贝海国际速递承运，从海外空运并清关后完成配送

        Bonded = 4, // 第三方保税.由非官方认证的第三方国际物流公司进行承运，从国内保税仓发货并清关后完成配送

        XloboBonded = 5, //贝海保税.由洋码头官方物流贝海国际速递进行承运，从国内保税仓发货并清关后完成配送

        OverSeaProxy = 6, //认证直邮，认证直邮.由洋码头官方认证的第三方国际物流公司进行承运，从海外空运并清关后完成配送

        OverSeaPinYou = 7, //拼邮，拼邮. 卖家集货后由非官方认证的第三方国际物流公司承运，头程从海外空运并清关后，再在国内分包由国内快递完成二程配送

		VirtualLogistics = 8, // 虚拟物流，
     */
    @Insert({
        "insert into Ymt_ExpressSellerToMode (id, SellerId, ",
        "CatalogStatus, hasAvailable, ",
        "isDelete, CreateTime, ",
        "Updatetime)",
        "values (#{id,jdbcType=CHAR}, #{sellerId,jdbcType=INTEGER}, ",
        "#{catalogStatus,jdbcType=INTEGER}, #{hasAvailable,jdbcType=BIT}, ",
        "#{isDelete,jdbcType=BIT}, #{createTime,jdbcType=TIMESTAMP}, ",
        "#{updatetime,jdbcType=TIMESTAMP})"
    })
    int insertYmtExpressSellerToMode(YmtExpressSellerToMode record);
    @Select("select * from Ymt_ExpressSellerToMode where SellerId=#{sellerid} and isDelete =0 and catalogStatus=#{catalogStatus}")
    List<YmtExpressSellerToMode> selectYmtExpressSellerToMode(@Param("sellerid")Integer sellerid,@Param("catalogStatus")Integer catalogStatus);
    @Update("update  Ymt_ExpressSellerToMode set isDelete =1 where SellerId=#{sellerid} and isDelete =0 and catalogStatus=#{catalogStatus}")
    int updateYmtExpressSellerToModeToDelete(@Param("sellerid")Integer sellerid,@Param("catalogStatus")Integer catalogStatus);

}